﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;

namespace TranslationProjectBuilder.Windows.Forms
{
    public static class TreeNodeFormat
    {
        public static void ChangeText(TreeNode treenode, string key, string tokey)
        {
            foreach (TreeNode node in treenode.Nodes)
            {
                ChangeText(treenode, key, tokey);
            }
        }

        public static void ChangeParentFont(Font font, TreeNodeCollection tnColllection)
        {
            foreach (TreeNode node in tnColllection)
            {
                if (node.Nodes.Count != 0)
                {
                    node.NodeFont = font;
                    ChangeParentFont(font, node.Nodes);
                }
            }
        }

        public static void ChangeSubTreeColor(Color color, TreeNodeCollection tnColllection)
        {
            foreach (TreeNode node in tnColllection)
            {
                node.ForeColor = color;
                ChangeSubTreeColor(color, node.Nodes);
            }
        }
    }
}
